<template>
  <view class="container">
    <view
      class="cell"
      v-for="(item, index) in links"
      :key="index"
      :data-path="item.path"
      @click="navigateTo"
    >
      <text class="title">{{item.title}}</text>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      links: [{
        path: '/pages/lazyload/lazyload',
        title: '延迟加载'
      }, {
        path: '/pages/multi/multi',
        title: '多个图表'
      }]
    };
  },
  methods: {
    navigateTo(e) {
      const dataset = e.currentTarget.dataset;
      uni.navigateTo({
        url: dataset.path
      });
    }
  }
}
</script>

<style>
.cell {
  padding: 10px 5px;
  text-align: center;
}
</style>
